package com.hopes.bizz.close.gis.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.Optional;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 进出园区VO
 * @time 2023/10/30 13:26
 */
@Data
public class EnterOuterVO implements Serializable {

    private static final long serialVersionUID = 2607377678858814872L;

    /**
     * 下标
     */
    private String index;

    /**
     * 人员数量
     */
    private int personNum;

    /**
     * 危险品数量
     */
    private int hazardNum;

    /**
     * 普通车辆数据
     */
    private int generalNum;


    public EnterOuterVO() {

    }

    public EnterOuterVO(String index) {
        this.index = index;
    }

    public EnterOuterVO(String index, Integer personNum, Integer hazardNum, Integer generalNum) {
        this.index = index.length() == 13 ? index + ":00" : index;
        this.personNum = Optional.ofNullable(personNum).orElse(0);
        this.hazardNum = Optional.ofNullable(hazardNum).orElse(0);
        this.generalNum = Optional.ofNullable(generalNum).orElse(0);
    }

}
